<template>
	<view class="leave-examine-card">
		<view class="card-wrap">
			<view class="card-content"  @click="handleClick">
				<view class="card-head">
					<view style="font-size: 32rpx; padding: 5rpx;font-weight:600;">{{leaveData.data.hvo.pk_wa_class.name}}</view>
					<view style="color: #aaaaaa;font-size: 24rpx; padding-top: 5rpx;">{{leaveData.data.hvo.billno}}</view>
				</view>
				<view style="font-size: 28rpx; padding: 5rpx;">{{leaveData.data.hvo.pk_dept.name}}</view>
					<view class="leave-reason" >
						<view class="leave-reason-sub">
							<view class="leave-reason-money">{{leaveData.data.hvo.pk_period}}</view>
							<view class="leave-reason-title">薪资期间</view>
						</view>
						<view class="leave-reason-sub" style="padding-right: 100rpx;">
							<view class="leave-reason-money">{{leaveData.data.itemcount['绩效总额']}}</view>
							<view class="leave-reason-title">绩效总额</view>
						</view>
					</view>
					<view class="inform-des">
						<view>提交人:{{leaveData.data.hvo.creator.name}}</view>
						<view>提交时间:{{leaveData.data.hvo.ts}}</view>
					</view>
			</view>
			<view class="card-btn" v-if="$store.state.isShowExa==1">
				<view class="btn-wrap">
				</view>
				<view class="btn-wrap">
					<view class="btn-wrap-sub">
						<my-button type="plain" @click="handleExit" height="50"  width="160">驳回</my-button>
						<my-button @click="handleAdopt" height="50" width="160">通过</my-button>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	
import apiData from '../../../common/utils/apiData.js'
import service from '../../../common/service/new_file.js'
import utils from '../../../common/utils/utils.js'
export default {
	name: 'merits-examine-card',
	data() {
		return {
			sumDays:0,
		};
	},
	props: {
		leaveData: {
			type: Object
		},
		isBtn:{
			default:0
		}
	},
	methods: {
		handleClick(){
			this.$emit('handleClick',this.leaveData);
		},
		deleteRec(){
			this.$emit('deleteRec', this.leaveData);
		},
		takeback(){
			this.$emit('takeback', this.leaveData);
		},
		handleExit() {
			//驳回直接就不进入指派流程
			this.$emit('exit');
		},
		handleAdopt() {
			this.$emit('adopt');
		},
		getReason(leaveType){
			let leaveArr = JSON.parse(uni.getStorageSync('leaveType'))
			let leaveshift = JSON.parse(uni.getStorageSync('leaveShift'))
			let newArr = [...leaveshift,...leaveArr]//请假的原因
			let str =utils.getLeavetyoe(newArr,leaveType)
			return str
		},
	},
	created() {
	},
	created() {
	},	
	watch: {
		leaveData: {
			handler(newValue, oldValue) {
				console.log('改变')
			},
			deep: true
		}
	}
};
</script>

<style lang="scss" scoped>
	.take-back-btn{
		display: flex;
		justify-content: center;
		height: 60rpx;
		line-height: 60rpx;
		width: 130rpx;
		color: #FFFFFF;
		border-radius: 38rpx;
		background: #d62000;
	}
	.leave-reason{
		display:flex;
		justify-content: space-between;
		align-items: center;
		color: #5b5b5b;
		padding: 15rpx 10rpx;
		
		.leave-reason-sub{
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			.leave-reason-money{
				font-weight: 600;
				font-size: 32rpx;
				color: #000000;
			}
			.leave-reason-title{
				margin-top: 8rpx;
				font-size: 26rpx;
			}
		}
	}
	.card-head{
		display: flex;
		justify-content: space-between;
		.head-delete-btn{
			height: 30rpx;
			width: 40rpx;
			color: red;
		}
	}
	.inform-des{
		display: flex;
		justify-content: space-between;
		font-size: 24rpx;
		color: #787878;
		padding: 6rpx 10rpx;
	}
.leave-examine-card {
	padding: 0 36rpx;
	.card-wrap {
		padding: 32rpx 28rpx 20rpx 28rpx;
		box-shadow: 0px 4px 12px 0px rgba(70, 66, 130, 0.1);
		border-radius: 8px;
		.card-content {
			// border-bottom: 1px solid #e5e5e5;
			.basic-inform {
				padding: 16rpx 0 6rpx 0;
				display: flex;
				justify-content: space-between;
				.basic-time {
					font-size: 24rpx;
					.star-time-wrap {
						padding: 8rpx 0;
						display: flex;
						.time-title {
							margin-right: 10rpx;
							color: #a7a3a3;
						}
						.time {
							color: #4a4a4a;
						}
					}
				}
				.leave-inform {
					display: flex;
					flex-direction: column;
					justify-content: center;
					align-items: center;
					font-size: 30rpx;
					.days {
						font-size: 30rpx;
						color: #007AFF;
						margin-bottom: 10rpx;
					}
				}
			}
		}
		.card-btn {
			display: flex;
			padding-top: 18rpx;
			justify-content: space-between;
			.btn-wrap{
				display: flex;
				justify-content: space-between;
				.btn-wrap-sub{
					display: flex;
					justify-content: space-between;
				}
			}
		}
	}
}
</style>
